<template>
  <div>
    <el-dialog v-bind="$attrs" v-on="$listeners" @open="onOpen" @close="onClose" title="Dialog Title">
      <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="110px">
        <el-form-item label="退回至公海" prop="pool">
          <el-select v-model="formData.pool" placeholder="选择要退回到的公海" clearable :style="{width: '100%'}">
            <el-option v-for="(item, index) in poolOptions" :key="index" :label="item.label"
                       :value="item.value" :disabled="item.disabled"
            ></el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <div slot="footer">
        <el-button @click="close">取消</el-button>
        <el-button type="primary" @click="handleConfirm">确定</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
export default {
  name: 'SendBack',
  inheritAttrs: false,
  components: {},
  props: {
    visible: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      formData: {
        pool: 0
      },
      rules: {
        pool: [{
          required: true,
          message: '选择要退回到的公海',
          trigger: 'change'
        }]
      },
      poolOptions: [{
        'label': '默认',
        'value': 0
      }, {
        'label': '销售一组',
        'value': 1
      }, {
        'label': '销售二组',
        'value': 2
      }]
    }
  },
  computed: {},
  watch: {},
  created() {
  },
  mounted() {
  },
  methods: {
    onOpen() {
    },
    onClose() {
      this.$refs['elForm'].resetFields()
    },
    close() {
      this.$emit('update:visible', false)
    },
    handleConfirm() {
      this.$refs['elForm'].validate(valid => {
        if (!valid) return
        this.close()
      })
    }
  }
}

</script>
<style>
</style>
